﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestXNA3.Render;
using TestXNA3.Resources;
using TestXNA3.Actors;
using System.Runtime.Serialization;

namespace TestXNA3.Components
{
    [Serializable]
    class PointLightComponent : Component
    {
        public override void AddToRenderQueue(SceneRenderer sceneRenderer, ref List<MeshResource> meshes)
        {
            SceneRenderer.LightDesc lightDesc = new SceneRenderer.LightDesc();

            lightDesc.Type = SceneRenderer.ELightType.Point;
            lightDesc.Location = Parent.Location;
            lightDesc.Diffuse = ((PointLight)Parent).Diffuse;
            lightDesc.Specular = ((PointLight)Parent).Specular;
            lightDesc.Intensity = ((PointLight)Parent).Intensity;
            lightDesc.Radius = ((PointLight)Parent).Radius;

            sceneRenderer.PushLight(ref lightDesc);
        }


        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
        }
    }
}
